package com.zyw.mvc.exception;

import java.util.Map;

/**
 * @author vill on 15/12/22 15:12.
 * @desc 请求参数异常
 */
public class InvalidParameterException extends AbstractDefaultException {

    private Map<String, String> errorMessage; // 参数验证，异常信息

    public InvalidParameterException(String message) {
        super(message);
    }

    public InvalidParameterException(Map<String, String> map) {
        super("Invalid parameter, please check!");
        this.errorMessage = map;
    }

    public InvalidParameterException(String msg, Map<String, String> map) {
        super(msg);
        this.errorMessage = map;
    }

    @Override
    public Integer getCode() {
        return -2;
    }

    public Map<String, String> getErrorMessage() {
        return errorMessage;
    }

}
